import 'package:taonile/generated/json/base/json_convert_content.dart';
import 'package:taonile/entity/shopping_car_list_entity.dart';

ShoppingCarListEntity $ShoppingCarListEntityFromJson(Map<String, dynamic> json) {
	final ShoppingCarListEntity shoppingCarListEntity = ShoppingCarListEntity();
	final int? code = jsonConvert.convert<int>(json['code']);
	if (code != null) {
		shoppingCarListEntity.code = code;
	}
	final String? msg = jsonConvert.convert<String>(json['msg']);
	if (msg != null) {
		shoppingCarListEntity.msg = msg;
	}
	final List<ShoppingCarListData>? data = jsonConvert.convertListNotNull<ShoppingCarListData>(json['data']);
	if (data != null) {
		shoppingCarListEntity.data = data;
	}
	return shoppingCarListEntity;
}

Map<String, dynamic> $ShoppingCarListEntityToJson(ShoppingCarListEntity entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['code'] = entity.code;
	data['msg'] = entity.msg;
	data['data'] =  entity.data.map((v) => v.toJson()).toList();
	return data;
}

ShoppingCarListData $ShoppingCarListDataFromJson(Map<String, dynamic> json) {
	final ShoppingCarListData shoppingCarListData = ShoppingCarListData();
	final String? storeId = jsonConvert.convert<String>(json['store_id']);
	if (storeId != null) {
		shoppingCarListData.storeId = storeId;
	}
	final String? storeExpressMoney = jsonConvert.convert<String>(json['store_express_money']);
	if (storeExpressMoney != null) {
		shoppingCarListData.storeExpressMoney = storeExpressMoney;
	}
	final String? storeBaseName = jsonConvert.convert<String>(json['store_base_name']);
	if (storeBaseName != null) {
		shoppingCarListData.storeBaseName = storeBaseName;
	}
	final String? storeLogo = jsonConvert.convert<String>(json['store_logo']);
	if (storeLogo != null) {
		shoppingCarListData.storeLogo = storeLogo;
	}
	final List<ShoppingCarListDataGoodsData>? goodsData = jsonConvert.convertListNotNull<ShoppingCarListDataGoodsData>(json['goods_data']);
	if (goodsData != null) {
		shoppingCarListData.goodsData = goodsData;
	}
	final bool? isCheck = jsonConvert.convert<bool>(json['isCheck']);
	if (isCheck != null) {
		shoppingCarListData.isCheck = isCheck;
	}
	return shoppingCarListData;
}

Map<String, dynamic> $ShoppingCarListDataToJson(ShoppingCarListData entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['store_id'] = entity.storeId;
	data['store_express_money'] = entity.storeExpressMoney;
	data['store_base_name'] = entity.storeBaseName;
	data['store_logo'] = entity.storeLogo;
	data['goods_data'] =  entity.goodsData.map((v) => v.toJson()).toList();
	data['isCheck'] = entity.isCheck;
	return data;
}

ShoppingCarListDataGoodsData $ShoppingCarListDataGoodsDataFromJson(Map<String, dynamic> json) {
	final ShoppingCarListDataGoodsData shoppingCarListDataGoodsData = ShoppingCarListDataGoodsData();
	final String? businessCartId = jsonConvert.convert<String>(json['business_cart_id']);
	if (businessCartId != null) {
		shoppingCarListDataGoodsData.businessCartId = businessCartId;
	}
	final String? goodsId = jsonConvert.convert<String>(json['goods_id']);
	if (goodsId != null) {
		shoppingCarListDataGoodsData.goodsId = goodsId;
	}
	final String? skuId = jsonConvert.convert<String>(json['sku_id']);
	if (skuId != null) {
		shoppingCarListDataGoodsData.skuId = skuId;
	}
	final String? num = jsonConvert.convert<String>(json['num']);
	if (num != null) {
		shoppingCarListDataGoodsData.num = num;
	}
	final String? shopGoodsName = jsonConvert.convert<String>(json['shop_goods_name']);
	if (shopGoodsName != null) {
		shoppingCarListDataGoodsData.shopGoodsName = shopGoodsName;
	}
	final String? mainImg = jsonConvert.convert<String>(json['main_img']);
	if (mainImg != null) {
		shoppingCarListDataGoodsData.mainImg = mainImg;
	}
	final String? imgPath = jsonConvert.convert<String>(json['img_path']);
	if (imgPath != null) {
		shoppingCarListDataGoodsData.imgPath = imgPath;
	}
	final String? price = jsonConvert.convert<String>(json['price']);
	if (price != null) {
		shoppingCarListDataGoodsData.price = price;
	}
	final List<ShoppingCarListDataGoodsDataSkuData>? skuData = jsonConvert.convertListNotNull<ShoppingCarListDataGoodsDataSkuData>(json['sku_data']);
	if (skuData != null) {
		shoppingCarListDataGoodsData.skuData = skuData;
	}
	final bool? isCheck = jsonConvert.convert<bool>(json['isCheck']);
	if (isCheck != null) {
		shoppingCarListDataGoodsData.isCheck = isCheck;
	}
	return shoppingCarListDataGoodsData;
}

Map<String, dynamic> $ShoppingCarListDataGoodsDataToJson(ShoppingCarListDataGoodsData entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['business_cart_id'] = entity.businessCartId;
	data['goods_id'] = entity.goodsId;
	data['sku_id'] = entity.skuId;
	data['num'] = entity.num;
	data['shop_goods_name'] = entity.shopGoodsName;
	data['main_img'] = entity.mainImg;
	data['img_path'] = entity.imgPath;
	data['price'] = entity.price;
	data['sku_data'] =  entity.skuData.map((v) => v.toJson()).toList();
	data['isCheck'] = entity.isCheck;
	return data;
}

ShoppingCarListDataGoodsDataSkuData $ShoppingCarListDataGoodsDataSkuDataFromJson(Map<String, dynamic> json) {
	final ShoppingCarListDataGoodsDataSkuData shoppingCarListDataGoodsDataSkuData = ShoppingCarListDataGoodsDataSkuData();
	final String? skuKey = jsonConvert.convert<String>(json['sku_key']);
	if (skuKey != null) {
		shoppingCarListDataGoodsDataSkuData.skuKey = skuKey;
	}
	final String? skuVal = jsonConvert.convert<String>(json['sku_val']);
	if (skuVal != null) {
		shoppingCarListDataGoodsDataSkuData.skuVal = skuVal;
	}
	return shoppingCarListDataGoodsDataSkuData;
}

Map<String, dynamic> $ShoppingCarListDataGoodsDataSkuDataToJson(ShoppingCarListDataGoodsDataSkuData entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['sku_key'] = entity.skuKey;
	data['sku_val'] = entity.skuVal;
	return data;
}